package com.ruoyi.cpsp.mapper;
/*
    @author neu.xiangwenjuan
    @create 2023/3/14
*/

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.cpsp.domain.CurrentPerformanceTotal;
import com.ruoyi.cpsp.domain.PreviousPerformanceData;
import com.ruoyi.cpsp.domain.PreviousPerformanceDataEn;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PreviousPerformanceDataMapper extends BaseMapper<PreviousPerformanceData> {

    List<PreviousPerformanceDataEn> selectAll(@Param("year") Integer year, @Param("quarter") Integer quarter);

    List<PreviousPerformanceDataEn> selectDataByIdCard(@Param("year") Integer year, @Param("quarter") Integer quarter, @Param("idCardList")List<String> idCardList);

    List<PreviousPerformanceDataEn> selectSelective(@Param("quarter")Integer quarter,
                                                    @Param("year")Integer year,
                                                    @Param("department")String department,
                                                    @Param("teamGroup")Integer teamGroup,
                                                    @Param("employeeInfo") String employeeInfo);

    CurrentPerformanceTotal selectDataTotal(@Param("quarter")Integer quarter,
                                            @Param("year")Integer year,
                                            @Param("departmentId")String departmentId,
                                            @Param("teamGroupId")Integer teamGroupId);

    double selectSum1();

    double selectSum2(@Param("year")Integer year);

    double selectSum3(@Param("idCardList")List<String> idCardList);

    double selectSum4(@Param("year")Integer year,
                      @Param("quarter")Integer quarter);

    double selectSum5(@Param("idCardList")List<String> idCardList,
                      @Param("quarter")Integer quarter);

    double selectSum6(@Param("idCardList")List<String> idCardList,
                      @Param("year")Integer year);

    double selectSum7(@Param("idCardList")List<String> idCardList,
                      @Param("year")Integer year,
                      @Param("quarter")Integer quarter);

    List<PreviousPerformanceData> selectPreviousIsEmpty(@Param("year")Integer year,
                                                        @Param("quarter")Integer quarter,
                                                        @Param("employee_idCard")String employee_idCard);


    int updateByPrimaryKeySelective(PreviousPerformanceData record);

    int deletePreviousPerformanceInfo(@Param("year")Integer year,
                                      @Param("quarter")Integer quarter,
                                      @Param("employeeIdCard")String employee_idCard);
}
